#include "CGamePlayState.h"
#include "CPlatform.h"
#include "CTextureManager.h"
#include "MMath.h"
#include "CGWindow.h"

void CGamePlayState::LoadLevel(void)
{
	m_pTextures[ARCH] = CTextureManager::GetInstance()->LoadTexture("img/columns/Awesomeness.tga");
	m_pTextures[CASTLE] = CTextureManager::GetInstance()->LoadTexture("img/columns/Castle.tga");
	m_pTextures[EGYPT_GATE] = CTextureManager::GetInstance()->LoadTexture("img/columns/EgyptianGate.tga");
	m_pTextures[EGYPT_PILLAR] = CTextureManager::GetInstance()->LoadTexture("img/columns/EgyptianPillar.tga");
	m_pTextures[EGYPT_PLAT] = CTextureManager::GetInstance()->LoadTexture("img/columns/EgyptianPlat.tga");
	m_pTextures[GOTH_PILLAR] = CTextureManager::GetInstance()->LoadTexture("img/columns/GothicPillar.tga");
	m_pTextures[GOTH_WINDOW1] = CTextureManager::GetInstance()->LoadTexture("img/columns/GothicWindow1.tga");
	m_pTextures[GOTH_WINDOW2] = CTextureManager::GetInstance()->LoadTexture("img/columns/GothicWindow2.tga");
	m_pTextures[GOTH_WINDOW3] = CTextureManager::GetInstance()->LoadTexture("img/columns/GothicWindow3.tga");
	m_pTextures[GREEKARCH] = CTextureManager::GetInstance()->LoadTexture("img/columns/GreekArch.tga");
	m_pTextures[GREEK_COL] = CTextureManager::GetInstance()->LoadTexture("img/columns/GreekColumn.tga");
	m_pTextures[MIDEVIL_PLAT] = CTextureManager::GetInstance()->LoadTexture("img/columns/MidEvilPlat.tga");

// STAIR WAY TO HEAVEN START!

	CPlatform *pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 7.0f;
	pPlatform->m_fOuterLimit = 10.0f;
	pPlatform->m_fThetaFirst = 1.3089f;
	pPlatform->m_fThetaSecond = 0.7853f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 7.0f;
	pPlatform->m_fOuterLimit = 12.0f;
	pPlatform->m_fThetaFirst = 1.9089f;
	pPlatform->m_fThetaSecond = 1.3089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 10.0f;
	pPlatform->m_fOuterLimit = 14.0f;
	pPlatform->m_fThetaFirst = 2.4089f;
	pPlatform->m_fThetaSecond = 1.8853f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 5.0f;
	pPlatform->m_fOuterLimit = 10.0f;
	pPlatform->m_fThetaSecond = -1.3089f;
	pPlatform->m_fThetaFirst = -0.7853f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 7.0f;
	pPlatform->m_fOuterLimit = 12.0f;
	pPlatform->m_fThetaSecond = -1.9089f;
	pPlatform->m_fThetaFirst = -1.3089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 10.0f;
	pPlatform->m_fOuterLimit = 14.0f;
	pPlatform->m_fThetaSecond = -2.2089f;
	pPlatform->m_fThetaFirst = -1.8853f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 14.0f;
	pPlatform->m_fOuterLimit = 17.0f;
	pPlatform->m_fThetaSecond = -2.63089f;
	pPlatform->m_fThetaFirst = -2.2853f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 18.0f;
	pPlatform->m_fOuterLimit = 21.0f;
	pPlatform->m_fThetaSecond = -3.1089f;
	pPlatform->m_fThetaFirst = -2.63089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 21.0f;
	pPlatform->m_fOuterLimit = 24.0f;
	pPlatform->m_fThetaSecond = -3.3089f;
	pPlatform->m_fThetaFirst = -3.13089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+7];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->m_bCollidable = false;
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 7.0f;
	pPlatform->m_fOuterLimit = 14.0f;
	pPlatform->m_fThetaSecond = -0.5089f;
	pPlatform->m_fThetaFirst = -0.13089f;
	pPlatform->m_pTexHandle = m_pTextures[EGYPT_GATE];
	pPlatform->CreateNoodle();

	//////////////////////////////////////////////////////////////////////////
	// KNIGHT LEVEL!!!!!
	//////////////////////////////////////////////////////////////////////////

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 31.0f;
	pPlatform->m_fOuterLimit = 34.0f;
	pPlatform->m_fThetaSecond = 1.3089f;
	pPlatform->m_fThetaFirst = 1.83089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+2];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 34.0f;
	pPlatform->m_fOuterLimit = 37.0f;
	pPlatform->m_fThetaSecond = 2.2089f;
	pPlatform->m_fThetaFirst = 2.73089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+2];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 37.0f;
	pPlatform->m_fOuterLimit = 40.0f;
	pPlatform->m_fThetaSecond = 3.089f;
	pPlatform->m_fThetaFirst = 3.63089f;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+2];
	pPlatform->CreateNoodle();

	pPlatform = new CPlatform;
	m_Objects.Add(pPlatform);
	pPlatform->Release();
	pPlatform->m_fInnerLimit = 41.0f;
	pPlatform->m_fOuterLimit = 44.0f;
	pPlatform->m_fThetaSecond = 1.6089f;;
	pPlatform->m_fThetaFirst = 2.1089f;;
	pPlatform->m_pTexHandle = m_pTextures[rand()%2+2];
	pPlatform->CreateNoodle();

	CGWindow *pWindow = new CGWindow(0, 0.3f, 0.5f, 26, 34, 4);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/castle.tga");

	pWindow = new CGWindow(0, 2.3f, 2.5f, 26, 34, 4);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/castle.tga");

	pWindow = new CGWindow(0, 1.1f, 1.3f, 26, 34, 4);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/castle.tga");

	pWindow = new CGWindow(0, 3.8f, 4.0f, 26, 34, 4);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/castle.tga");

	pWindow = new CGWindow(0, 5.0f, 5.2f, 26, 34, 4);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/castle.tga");

	pWindow = new CGWindow(0, 2.7f, 3.4f, 9, 15, 7);
	m_Objects.Add(pWindow);
	pWindow->m_pTex = CTextureManager::GetInstance()->LoadTexture("img/columns/awesomeness.tga");
}